<?php
/**
 * @package     Joomla.Site
 * @subpackage  Layout
 * @customize Ai Pham
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;?>
<?php
// Create a shortcut for params.
$params = $this->item->params;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$canEdit = $this->item->params->get('access-edit');
JHtml::_('behavior.framework');
	$keywordyear = date(Y);
	$db = & JFactory::getDBO();
	$querynewslist = "SELECT * FROM #__content WHERE catid='8' and publish_up like '%$keywordyear%' and state=1";					
	$db->setQuery($querynewslist);
	$newslist = $db->loadObjectList();
for($i=0;$i<count($newslist);$i++){
	$itemnews = $newslist[$i];
?>
<div class="roomtemplateitem">
	<?php
	$imgintro=$itemnews->images;
	$imgintro=explode('image_intro":"',$imgintro);
	$imgintro=explode('","',$imgintro[1]);
	$imgintro=str_replace('\/','/',$imgintro[0]);
    if($imgintro!=""){
    ?>
	<div class="imgcategory">
        <div class="pull-left item-image">
        	<img src="<?php echo $imgintro;?>" alt="<?php echo $itemnews->alias;?>" title="<?php echo $itemnews->title;?>" />
        </div>
    </div>
	<?php
	}
    ?>
	<div class="introcategory">
    	<div class="page-header">
            <h2>
            	<a href="index.php?option=com_content&view=article&id=<?php echo $itemnews->id?>&catid=<?php echo $itemnews->catid?>&Itemid=109">
					<?php echo $itemnews->title;?>
                </a>
            </h2>
        </div>
        <div class="datepublish">
		<?php
        $datepublishup = strtotime($itemnews->publish_up);
        echo date("F d, Y",$datepublishup);
        ?>
        </div>
        <div class="contentarticle">
        	<?php echo $itemnews->introtext; ?>
        </div>
    </div>
</div>
<?php
}
?>
